﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 第二次作业
{
    public class TrustAccount:Account
    {
        public double trustcredit { get; set;}
        public void withdrow(double money)
        {
            if(trustcredit < money)
            {
                //提示信用金额不足
                MessageBox.Show("信用卡额度不足");
            }
            else
            {
                EventFunction eventFunction = new EventFunction();
                involeDefine involeDefine = new involeDefine();
                if (money > 10000)
                {
                    involeDefine.moneyevent += eventFunction.BigMoney;
                    involeDefine.invoke();
                }
                this.trustcredit -= money;
                MessageBox.Show("操作成功");
            }
        }

        public void payback(double money)
        {
            trustcredit += money;
            MessageBox.Show("操作成功");
        }
    }


}
